Skip to content

FGA_3: check()#568

Merged
swaroopAkkineniWorkos merged 6 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
fga-pr2
Feb 24, 2026
Merged

FGA_3: check()#568
swaroopAkkineniWorkos merged 6 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
fga-pr2

Conversation

@swaroopAkkineniWorkos
Copy link

Description

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title FGA pt 2 FGA pt 3 Feb 20, 2026
@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title FGA pt 3 FGA pt 3: check() Feb 20, 2026
@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title FGA pt 3: check() FGA_3: check() Feb 20, 2026
@swaroopAkkineniWorkos
Copy link
Author

@greptile review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 21, 2026

Greptile Summary

Added check() method to Authorization module for Fine-Grained Authorization (FGA) access evaluation. The implementation follows established SDK patterns with both sync/async support, proper type safety using TypedDict for resource identifiers, and comprehensive test coverage.

  • Implemented check() in both Authorization and AsyncAuthorization classes
  • Created ResourceIdentifier union type supporting resource ID and external ID identification
  • Added thorough test suite covering authorized/unauthorized checks, both identifier types, and URL construction
  • Properly exported new types in __init__.py for public API

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows all existing SDK patterns perfectly, includes comprehensive test coverage for both sync/async variants and all input types, uses proper type safety with TypedDict, and passes all custom instruction checks. No security concerns, no breaking changes, and consistent with codebase conventions.
  • No files require special attention

Important Files Changed

Filename Overview
src/workos/authorization.py Added check() method for access evaluation in both sync and async Authorization classes, following existing SDK patterns
src/workos/types/authorization/init.py Exported new ResourceIdentifier types for type safety
src/workos/types/authorization/resource_identifier.py Created TypedDict types for resource identification by ID or external ID
tests/test_authorization_check.py Comprehensive test coverage for check() method including both resource identifier types and sync/async variants

Last reviewed commit: 4ccc1d9

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

organization_membership_id: str,
*,
permission_slug: str,
resource: ResourceIdentifier,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's rename to resource_identifier

@swaroopAkkineniWorkos swaroopAkkineniWorkos marked this pull request as ready for review February 23, 2026 17:52
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested a review from a team as a code owner February 23, 2026 17:52
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested review from atainter, csrbarber and jonatascastro12 and removed request for a team February 23, 2026 17:52
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@swaroopAkkineniWorkos swaroopAkkineniWorkos merged commit a50f5d5 into ENT-5224-python-sdk-for-fga-worktree-fuck-around Feb 24, 2026
11 checks passed
@swaroopAkkineniWorkos swaroopAkkineniWorkos deleted the fga-pr2 branch February 24, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant